import Mock from 'mockjs'
const order = Mock.mock({
  'items|10': [
    {
      ruleId: '@id',
      'amount|1-100': 100,
      ruleCode: '@string(5)',
      ruleName: '@ctitle(3,5)',
      'ruleTypeId|1': [1, 2, 3],
      'status|1': [1, 2],
      typeCode: '@string(5)',
      typeName: '@string("upper", 5)',
      CreationTime: '@now()'
    }
  ]
})
const items = Mock.mock({
  'items|10': [
    {
      'amount|1-99': 1,
      'incomeId': '@id',
      'incomeTime': '@now',
      'isMore': 0,
      'items': [],
      'pageIndex': 0,
      'pageSize': 0,
      'personalId': '@id',
      'redpackRuleVo': {
        'amount|1-99': 1,
        'isMore': 0,
        'items': [],
        'pageIndex': 0,
        'pageSize': 0,
        'ruleCode': 'code',
        'ruleId': '@id',
        'ruleName': '规则',
        'ruleTypeId': '@id',
        'startIndex': 0,
        'status': 0,
        'totalNum': 0,
        'totalPage': 0,
        'typeCode': '',
        'typeName': '类型'
      },
      'ruleId': '@id',
      'startIndex': 0,
      'totalNum': 0,
      'totalPage': 0
    }
  ]
})
const zcmx = Mock.mock({
  'items|10': [
    {
      'amount|1-99': 1,
      'expendId': '@id',
      'expendTime': '@now',
      'isMore': 0,
      'items': [],
      'orderId': '@id',
      'orderVo': {
        'address': '@city',
        'cancelTime': '@now',
        'city': '@city',
        'confirmTime': '@now',
        'county': '@city',
        'logisticsNum': '@id',
        'logisticsType|1': [1, 2],
        'logisticsTypeString': '@name',
        'mobile': '127333737',
        'orderCommodityVoList': [
          {
            'careNote': '注意是想',
            'commodityId': '@id',
            'commodityName': '@cname',
            'commodityNo': '@id',
            'count|1-99': 1,
            'exchangeNote': '说明',
            'introduction': '介绍',
            'orderCommodityId': '@id',
            'orderId': '@id',
            'price|1-99': 1,
            'releaseTime': '@now',
            'totalPrice|1-99': 1,
            'type|1': [1, 2],
            'typeString': '食物'
          }
        ],
        'orderId': '@di',
        'orderNo': '@id',
        'orderPrice|1-99': 1,
        'placeTime': '@now',
        'province|1-99': 9,
        'receiver': '@name',
        'sendTime': '@now',
        'status|1': [1, 2, 3, 4],
        'statusString': ''
      },
      'pageIndex': 0,
      'pageSize': 0,
      'personalId': '',
      'startIndex': 0,
      'totalNum': 0,
      'totalPage': 0
    }
  ]
})
const pub = {
  isMore: 0,
  pageIndex: 1,
  pageSize: 10,
  startIndex: 0,
  totalNum: 30,
  totalPage: 1
}
const dictMap = {
  status: {
    1: '下单',
    2: '发货',
    3: '确认',
    4: '取消'
  }
}
export default [
  {
    url: '/shopping/redpack/getRedpackExpendListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...zcmx,
          ...pub
        },
        dictMap,
        msg: ''
      }
    }
  },
  {
    url: '/shopping/redpack/getRedpackIncomeListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...items,
          ...pub
        },
        msg: ''
      }
    }
  },
  // 删除红包规则
  {
    url: '/shopping/redpack/removeRedpackRule',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
        },
        msg: ''
      }
    }
  },
  // 修改保存红包规则
  {
    url: '/shopping/redpack/modifyRedpackRule',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
        },
        msg: ''
      }
    }
  },
  // 分页查询红包规则集合
  {
    url: '/shopping/redpack/getRedpackRuleListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        msg: ''
      }
    }
  },
  // 根据参数查询红包规则
  {
    url: '/shopping/redpack/getRedpackRuleList',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        msg: ''
      }
    }
  },
  // 根据id查询红包规则
  {
    url: '/shopping/redpack/getRedpackRuleById',
    type: 'get',
    response: config => {
      return {
        code: 1,
        data: {
          ...order.items[0]
        },
        msg: ''
      }
    }
  },
  // 新增保存红包规则
  {
    url: '/shopping/redpack/addRedpackRule',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {},
        msg: '保存成功'
      }
    }
  },
  // 分页查询订单集合
  {
    url: '/shopping/redpack/getRedpackRuleTypeListPage',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order,
          ...pub
        },
        msg: ''
      }
    }
  },
  //   新增红包管理
  {
    url: '/shopping/redpack/addRedpackRuleType',
    type: 'post',
    response: config => {
      return {
        code: 1,
        data: {
          ...order
        },
        msg: '保存成功'
      }
    }
  }
]
